package com.cn.goodsadmin.po;

import com.cn.goodsadmin.util.TimeUtil;

import javax.persistence.*;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

@Entity
@Table(name = "t_panicLog", schema = "c_goods", catalog = "")
public class PanicLog {
  private int cId;
  private String cOpenid;
  private String cPid;
  private byte cStatus=(byte)0;
  private byte cType=(byte)0;
  private String cGid;
  private Date cTime= TimeUtil.getCurrTimeHm();
  private int cAppid;
  private String cAid;
  private String cPrice;
  private String cGname;
  private String cUsername;
  private Date cMtime=TimeUtil.getCurrTimeHm();
  private String cLogisticsid;
  private int cAddrid;

  //c_logisticsid
  @Basic
  @Column(name = "c_logisticsid", nullable = true, length = 20)
  public String getcLogisticsid() {
    return cLogisticsid;
  }

  public void setcLogisticsid(String cLogisticsid) {
    this.cLogisticsid = cLogisticsid;
  }


  @Basic
  @Column(name = "c_addrid", nullable = true)
  public int getcAddrid() {
    return cAddrid;
  }

  public void setcAddrid(int cAddrid) {
    this.cAddrid = cAddrid;
  }

  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "c_id", nullable = false)
  public int getcId() {
    return cId;
  }

  public void setcId(int cId) {
    this.cId = cId;
  }

  @Basic
  @Column(name = "c_openid", nullable = false, length = 50)
  public String getcOpenid() {
    return cOpenid;
  }

  public void setcOpenid(String cOpenid) {
    this.cOpenid = cOpenid;
  }

  @Basic
  @Column(name = "c_pid", nullable = false, length = 20)
  public String getcPid() {
    return cPid;
  }

  public void setcPid(String cPid) {
    this.cPid = cPid;
  }

  @Basic
  @Column(name = "c_status", nullable = false)
  public byte getcStatus() {
    return cStatus;
  }

  public void setcStatus(byte cStatus) {
    this.cStatus = cStatus;
  }

  @Basic
  @Column(name = "c_type", nullable = false)
  public byte getcType() {
    return cType;
  }

  public void setcType(byte cType) {
    this.cType = cType;
  }

  @Basic
  @Column(name = "c_gid", nullable = false, length = 20)
  public String getcGid() {
    return cGid;
  }

  public void setcGid(String cGid) {
    this.cGid = cGid;
  }

  @Basic
  @Column(name = "c_time", nullable = false)
  public Date getcTime() {
    return cTime;
  }

  public void setcTime(Date cTime) {
    this.cTime = cTime;
  }

  @Basic
  @Column(name = "c_appid", nullable = false)
  public int getcAppid() {
    return cAppid;
  }

  public void setcAppid(int cAppid) {
    this.cAppid = cAppid;
  }

  @Basic
  @Column(name = "c_aid", nullable = true)
  public String getcAid() {
    return cAid;
  }

  public void setcAid(String cAid) {
    this.cAid = cAid;
  }

  @Basic
  @Column(name = "c_price", nullable = false, length = 20)
  public String getcPrice() {
    return cPrice;
  }

  public void setcPrice(String cPrice) {
    this.cPrice = cPrice;
  }

  @Basic
  @Column(name = "c_gname", nullable = false, length = 20)
  public String getcGname() {
    return cGname;
  }

  public void setcGname(String cGname) {
    this.cGname = cGname;
  }

  @Basic
  @Column(name = "c_username", nullable = true, length = 20)
  public String getcUsername() {
    return cUsername;
  }

  public void setcUsername(String cUsername) {
    this.cUsername = cUsername;
  }

  @Basic
  @Column(name = "c_mtime", nullable = false)
  public Date getcMtime() {
    return cMtime;
  }

  public void setcMtime(Date cMtime) {
    this.cMtime = cMtime;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    PanicLog panicLog = (PanicLog) o;

    if (cId != panicLog.cId) return false;
    if (cStatus != panicLog.cStatus) return false;
    if (cType != panicLog.cType) return false;
    if (cAppid != panicLog.cAppid) return false;
    if (cOpenid != null ? !cOpenid.equals(panicLog.cOpenid) : panicLog.cOpenid != null) return false;
    if (cPid != null ? !cPid.equals(panicLog.cPid) : panicLog.cPid != null) return false;
    if (cGid != null ? !cGid.equals(panicLog.cGid) : panicLog.cGid != null) return false;
    if (cTime != null ? !cTime.equals(panicLog.cTime) : panicLog.cTime != null) return false;
    if (cAid != null ? !cAid.equals(panicLog.cAid) : panicLog.cAid != null) return false;
    if (cPrice != null ? !cPrice.equals(panicLog.cPrice) : panicLog.cPrice != null) return false;
    if (cGname != null ? !cGname.equals(panicLog.cGname) : panicLog.cGname != null) return false;
    if (cUsername != null ? !cUsername.equals(panicLog.cUsername) : panicLog.cUsername != null) return false;
    if (cMtime != null ? !cMtime.equals(panicLog.cMtime) : panicLog.cMtime != null) return false;

    return true;
  }

  @Override
  public int hashCode() {
    int result = cId;
    result = 31 * result + (cOpenid != null ? cOpenid.hashCode() : 0);
    result = 31 * result + (cPid != null ? cPid.hashCode() : 0);
    result = 31 * result + (int) cStatus;
    result = 31 * result + (int) cType;
    result = 31 * result + (cGid != null ? cGid.hashCode() : 0);
    result = 31 * result + (cTime != null ? cTime.hashCode() : 0);
    result = 31 * result + cAppid;
    result = 31 * result + (cAid != null ? cAid.hashCode() : 0);
    result = 31 * result + (cPrice != null ? cPrice.hashCode() : 0);
    result = 31 * result + (cGname != null ? cGname.hashCode() : 0);
    result = 31 * result + (cUsername != null ? cUsername.hashCode() : 0);
    result = 31 * result + (cMtime != null ? cMtime.hashCode() : 0);
    return result;
  }
}
